define(function() {
    'use strict';
    /**
     * this function is used to alert information;
     * @param  {String} messages [be use to add the message]
     * @param  {String} status   status resume 'confirm' || 'warning' || other
     * @return void
     */
    $.lightTips = function(messages, status) {
        var currentStatus = status || '';
        var $lightTipDom = $('.lightTipMessage');
        var diffStatusDom = '<div class="messages"><ul><li><div class="diffIcon"></div></li><li ><div class="messages">' + messages + '</div></li></ul></div>';
        var createDom = function() {
            $lightTipDom.append(diffStatusDom);
            $lightTipDom.css({
                '-webkit-transform': 'translateY(-40px)'
            });
        };
        if ($lightTipDom.find('.messages').length === 0) {
            createDom();
        } else {
            $('.messages').remove();
            createDom();
        }
        var $msgDOM = $('.lightTipMessage .messages .diffIcon');
        switch (currentStatus) {
            case 'confirm':
                $msgDOM.css({
                    'background': 'url(' + $.i18n.image('confirm.svg') + ') no-repeat',
                    'background-size': '100% 100%'
                });
                break;
            case 'warning':
                $msgDOM.css({
                    'background': 'url(' + $.i18n.image('warn.svg') + ') no-repeat',
                    'background-size': '100% 100%'
                });
                break;
            default:
                $msgDOM.css({
                    'background': 'url(' + $.i18n.image('information.svg') + ') no-repeat',
                    'background-size': '100% 100%'
                });
                break;
        }
        /*
        when 3s the alert information is remove automatic;
         */
        _.delay(function() {
            $lightTipDom.css({
                '-webkit-transform': 'translateY(40px)'
            });
            $('.messages').remove();
        }, 3000);
    };
});